﻿using System;
using System.Collections.Generic;
using System.Data.Entity.Spatial;
using System.Linq;
using System.Security;
using System.Text;

namespace DevWeb.Biztalk.DeploymentSettings.Data.CodeFirst
{
    public partial class IntegrationVersionParameter
    {
        public int Id { get; set; }

        public virtual IntegrationVersion IntegrationVersion
        {
            get;
            set;
        }

        public virtual ICollection<IntegrationVersionParameterValue> IntegrationVersionParameterValues
        {
            get;
            set;
        }

        public virtual int IntegrationVersionId
        {
            get;
            set;
        }

        public string ParameterName
        {
            get;
            set;
        }

        public  string DefaultValue
        {
            get;
            set;
        }

        public virtual System.DateTime CreateDateTime
        {
            get;
            set;
        }



        public string Version
        {
            get
            {
                var integrationVersion = this.IntegrationVersion;
                if (integrationVersion != null)
                    return integrationVersion.Version;
                return null;
            }
        }


        public string IntegrationName
        {
            get
            {
                var integrationVersion = this.IntegrationVersion;
                if (integrationVersion != null)
                    if (integrationVersion.Integration != null) return integrationVersion.Integration.Name;
                return null;
            }
        }

        public Guid ProductId
        {
            get
            {
                if (IntegrationVersion != null) return IntegrationVersion.ProductId;
                return new Guid();
            }
        }

        
    }
}
